package com.itcam.interview.pro00.disignmodel.chain;

// 3. 构建责任链并发起请求
public class LeaveApprovalChainExample {
    public static void main(String[] args) {
        // 创建处理者
        Approver teamLeader = new TeamLeader();
        Approver manager = new Manager();
        Approver director = new Director();

        // 构建责任链
        teamLeader.setNextApprover(manager).setNextApprover(director);

        // 发起请求
        teamLeader.processRequest(1);
        teamLeader.processRequest(3);
        teamLeader.processRequest(5);
        teamLeader.processRequest(7);
    }
}